package com.wei800.turnover.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wei800.common.util.bean.DeepBeanUtils;
import com.wei800.dto.MemberDTO;
import com.wei800.service.IMemberService;
import com.wei800.turnover.mapper.IMemberMapper;
import com.wei800.turnover.entity.Member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl extends ServiceImpl<IMemberMapper, Member> implements IMemberService<Member> {
    @Autowired
    private IMemberMapper memberDAO;

    @Override
    public List<MemberDTO> listAll() {
        List<MemberDTO> result = DeepBeanUtils.copyListProperties(this.memberDAO.findAll(), MemberDTO::new);
        return result;
    }
}

